<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>APP</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../font/iconfont.css" />
    <script src="../font/iconfont.js"></script>
    <style>
    .icon {
      width: 1.5em;
      height: 1.5em;
      vertical-align: -0.3rem;
      fill: currentColor;
      overflow: hidden;
      margin-left: 0.6rem;
      margin-right: 1rem;
    }
    </style>
</head>


<body>
  <div id="list"></div>

  </body>

      <script id="myhome" type="text/x-dot-template">

        <ul class="aui-list aui-list-in" style="margin:0.6rem 0;">
  <li class="aui-list-item" data-url="my_name" onclick="fnOpenWinCommon(this,{phone:{{? it.head_img}}'{{=it.head_img}}'{{??}}''{{?}}})" >


                    <div class="aui-list-item-inner aui-list-item-arrow">
                        <div class="aui-list-item-title"><svg class="icon" aria-hidden="true">
  <use xlink:href="#iconsk-1gerenzhongxin20x20"></use>
</svg>我的昵称</div>
                        <div class="aui-list-item-right" id="name">
{{=it.nickname}}
                        </div>
                    </div>
                  </li>
                  <li class="aui-list-item" data-url="my_phone" onclick="fnOpenWinCommon(this,{phone:{{=it.phone}}})" >

                    <div class="aui-list-item-inner aui-list-item-arrow">
                        <div class="aui-list-item-title"><svg class="icon" aria-hidden="true">
  <use xlink:href="#iconsk-shouji"></use>
</svg>我的手机</div>
                        <div class="aui-list-item-right" id="phone">
  {{=it.phone}}
                        </div>
                    </div>

                  </li>
                  <li class="aui-list-item" data-url="my_qq" onclick="fnOpenWinCommon(this)">
                    <!-- <div class="aui-list-item-label-icon">
                        <i class="aui-iconfont aui-icon-camera"></i>
                    </div> -->
                    <div class="aui-list-item-inner aui-list-item-arrow">
                        <div class="aui-list-item-title"><svg class="icon" aria-hidden="true">
  <use xlink:href="#iconsk-qq1"></use>
  </svg>我的QQ</div>
                        <div class="aui-list-item-right" id="qq">
{{=it.qq}}
                        </div>
                    </div>
                  </li>

                  <li class="aui-list-item" style="display:none">
                    <!-- <div class="aui-list-item-label-icon">
                        <i class="aui-iconfont aui-icon-camera"></i>
                    </div> -->
                    <div class="aui-list-item-inner aui-list-item-arrow" data-url="my_address" onclick="fnOpenWinCommon(this)">
                        <div class="aui-list-item-title">收货地址</div>
                        <div class="aui-list-item-right">

                        </div>
                    </div>
                  </li>

              </ul>
              <ul class="aui-list aui-list-in" style="margin:0.5rem 0;">
              <li class="aui-list-item" {{? it.name_status==null}} onclick="fnOpenWin(this)" {{?? it.name_status=="0" }} onclick="alert('审核中')" {{?? it.name_status=="1" }} onclick="alert('已认证')" {{?? it.name_status=="-1" }} onclick="fnOpenWin2(this)" {{?}} data-name="real_name">
                  <div class="aui-list-item-inner aui-list-item-arrow">
                      <div class="aui-list-item-title" id="real-name" name_status="{{=it.name_status}}"><svg class="icon" aria-hidden="true">
<use xlink:href="#iconsk-emishenfenzheng2

"></use>
</svg>实名认证</div>

                      <div class="aui-list-item-right">
                          {{? it.name_status==null}} 点击认证 {{?? it.name_status=="0"}} 审核中 {{?? it.name_status=="1"}} 认证成功 {{?? it.name_status=="-1"}} 认证失败 {{?}}
                      </div>


                  </div>
              </li>
              <li class="aui-list-item" onclick="fnOpenWin1(this)" data-name="taobao_bind">
                  <div class="aui-list-item-inner aui-list-item-arrow">
                      <div class="aui-list-item-title"><svg class="icon" aria-hidden="true">
<use xlink:href="#iconsk-taobao"></use>
</svg>淘号绑定</div>
                      <div class="aui-list-item-right">
                          点击绑定
                      </div>
                  </div>
              </li>
              <li class="aui-list-item" onclick="fnOpenWin1(this)" data-name="jingdong_bind">
                  <div class="aui-list-item-inner aui-list-item-arrow">
                      <div class="aui-list-item-title"><svg class="icon" aria-hidden="true">
<use xlink:href="#iconsk-jingdong-"></use>
</svg>京号绑定</div>
                      <div class="aui-list-item-right">
                          点击绑定
                      </div>
                  </div>
              </li>
              <input type="hidden" id="nameReal" value="{{=it.name}}"/>

              <li class="aui-list-item" onclick="fnOpenWin(this)" data-name="alipay_bind">
                  <div class="aui-list-item-inner aui-list-item-arrow">
                      <div class="aui-list-item-title"><svg class="icon" aria-hidden="true">
<use xlink:href="#iconsk-iconfontrectangle390"></use>
</svg>支付宝绑定</div>
                      <div class="aui-list-item-right">
                          点击绑定
                      </div>
                  </div>
              </li>
              </ul>

                    <ul class="aui-list aui-list-in" style="margin:0.6rem 0;">


                              <li class="aui-list-item"  onclick="fnOpenWinCommon(this)" data-url="my_password">
                                <!-- <div class="aui-list-item-label-icon">
                                    <i class="aui-iconfont aui-icon-camera"></i>
                                </div> -->
                                <div class="aui-list-item-inner aui-list-item-arrow">
                                    <div class="aui-list-item-title"><svg class="icon" aria-hidden="true">
              <use xlink:href="#iconsk-qunfengxiugaimima
            "></use>
            </svg>修改密码</div>
                                    <div class="aui-list-item-right">
                                        点击修改
                                    </div>
                                </div>
                              </li>

                          </ul>

                    <div class="" style="padding:0 1rem;margin:1.5rem 0;border:none;">
                        <div tapmode onclick="fnLoginOutCommon()" style="border-radius:0.6rem;border:1px solid #ccc;text-align:center;line-height:2.4rem;background:#ff4285;color:#fff;width:100%；">退出登录</div>
                    </div>
                    <ul class="aui-list aui-list-in" style="margin:0.6rem 0;">


                              <li class="aui-list-item"  onclick="fnOpenWinCommon(this)" data-url="ztf">
                                <!-- <div class="aui-list-item-label-icon">
                                    <i class="aui-iconfont aui-icon-camera"></i>
                                </div> -->
                                <div class="aui-list-item-inner aui-list-item-arrow">
                                    <div class="aui-list-item-title">拽头发</div>
                                    <div class="aui-list-item-right">
                                        点击退出
                                    </div>
                                </div>
                              </li>

                          </ul>


      </script>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="./conf/config.js"></script>
<script type="text/javascript" src="./js/common.js"></script>
<script type="text/javascript" src="../script/doT.min.js"></script>
<script type="text/javascript">

    apiready = function() {
      //fnGetDataCommon(template_,url_,method_,data_,userinfo_=1)
      fnGetDataCommon("MyHome","index.php?m=api&c=appnew&a=get_userinfo","get");

        //fnGetUserInfo(); //获取用户信息分配到模板
      initRefreshCommon('fnGetDataCommon("MyHome","index.php?m=api&c=appnew&a=get_userinfo","get")');

    };
    //分配数据到模板；
    function MyHomeRes(ret){
        //var dataInter = {"name":"Jake","age":31};
        var interText = doT.template($("#myhome").text());
        $("#list").html(interText(ret));
        
    }
    function fnOpenWin2(that){
      alert("重新认证！");

      api.openWin({
          name: "re_real_name",
          url: './re_real_name.html',
          opaque: true,
          cScrollBarEnabled: false,

      })
      // var name = $(that).attr("data-name");
      // api.openWin({
      //     name: name,
      //     url: './' + name + '.html',
      //     opaque: true,
      //     cScrollBarEnabled: false,
      // })
    }
    function fnOpenWin1(that){
      var name = $(that).attr("data-name");
      api.openWin({
          name: name,
          url: './' + name + '.html',
          opaque: true,
          cScrollBarEnabled: false,
      })
    }
    function fnOpenWin(that) {
        var nameStatus = $("#real-name").attr("name_status");

        switch (nameStatus) {
            case 'null':
            alert("请进行实名认证！")
                var name = "real_name";
                break;
            case '1':
                var name = $(that).attr("data-name");
                break;
            case '-1':
              var msg="实名认证失败，请重新进行认证！";

                break;
            case '0':
            var msg="实名认证正在审核中，请耐心等待！";

                break;
            default:

        }
        if(msg){
          alert(msg);
        }

// var name = $(that).attr("data-name");
//         if (name == "alipay_bind") {
//             //访问实名认证接口
//             var userInfo = $api.getStorage('userInfo');
//             var name_status = userInfo.name_status;
//             var is_real_name = name_status;
//             if (is_real_name == "NULL") {
//                 var name = 'real_name';
//             } else if (is_real_name == '0') {
//                 alert("等待实名认证审核结果");
//                 return false;
//             } else if (is_real_name == '-1') {
//                 alert("实名认证失败");
//                 return false;
//             }
//
//         }
        if(name=="alipay_bind"){

            var userInfo = $api.getStorage("userInfo");
             var userid = userInfo.userid;
             var random = userInfo.random;

            api.ajax({
                 url: SITE_URL+'index.php?m=api&c=appnew&a=cash_account_info',
                method: 'post',
                 data: {
                    values: {
                         "userid": userid,
                         "random": random,
                     }
                 }
           }, function(ret, err) {
                  if(ret.status==5){

                    api.openWin({
                        name: "alipay_bind",
                        url: './alipay_bind.html',
                        opaque: true,
                        cScrollBarEnabled: false,
                    });

                  }else if(ret.status==1){
                    var realName5=$("#nameReal").val();
                    //alert(realName5);
                    api.openWin({
                        name: "list_alipay_bind",
                        url: './list_alipay_bind.html',
                        pageParam: {
                          realName: realName5
                        },
                        opaque: true,
                        cScrollBarEnabled: false,
                    });
                  }

              });


        }else{
          api.openWin({
              name: name,
              url: './' + name + '.html',
              opaque: true,
              cScrollBarEnabled: false,
          })

        }




    }
// function dianwo(that,json){
//   api.openWin({
//       name: 'my_phone',
//       url: './my_phone.html',
//       pageParam: json
//   });
//
// }
</script>

</html>
